<?php

class CompanyProfileInfo extends BaseEntity{

	public static $type = "CompanyProfileInfo";

	function __construct($id = 0){
		parent::__construct($id);
	}

	function update($params){
		$this->name = empty($params["name"]) ? $this->name : $params["name"];
		$this->phone = empty($params["phone"]) ? $this->phone : $params["phone"];
		$this->email = empty($params["email"]) ? $this->email : $params["email"];
		$this->tags = empty($params["tags"]) ? $this->tags : $params["tags"];
		$this->address= empty($params["address"]) ? $this->address : $params["address"];
 		$this->save(false);
	}

	static function buildProfileResponseFromObj($profile){
		$response = new StdClass();

		$response->id = $profile->id;
		$response->name = $profile->name;
		$response->email = $profile->email;
		$response->address = $profile->address;
		$response->phone = $profile->phone;
		$response->tags = $profile->tags;

		return $response;
	}
}
